Stop requiring files that is to be autoloaded.

cf. https://github.com/rails/rails/issues/15767

Back out the move `load_types_in`, which was innocent because it does
not load anything.

Have to make sure #502 does not recur.

Akinori MUSHA 10 anni fa
parent
commit
a6c16f07ac
2 ha cambiato i file con 2 aggiunte e 8 eliminazioni
  1. 2 6
      app/models/agent.rb
  2. 0 2
      app/models/event.rb

+ 2 - 6
app/models/agent.rb

@@ -1,6 +1,3 @@
1
-require 'json_serialized_field'
2
-require 'assignable_types'
3
-require 'markdown_class_attributes'
4 1
 require 'utils'
5 2
 
6 3
 # Agent is the core class in Huginn, representing a configurable, schedulable, reactive system with memory that can
@@ -18,6 +15,8 @@ class Agent < ActiveRecord::Base
18 15
 
19 16
   markdown_class_attributes :description, :event_description
20 17
 
18
+  load_types_in "Agents"
19
+
21 20
   SCHEDULES = %w[every_1m every_2m every_5m every_10m every_30m every_1h every_2h every_5h every_12h every_1d every_2d every_7d
22 21
                  midnight 1am 2am 3am 4am 5am 6am 7am 8am 9am 10am 11am noon 1pm 2pm 3pm 4pm 5pm 6pm 7pm 8pm 9pm 10pm 11pm never]
23 22
 
@@ -404,9 +403,6 @@ class Agent < ActiveRecord::Base
404 403
     end
405 404
     handle_asynchronously :async_check
406 405
   end
407
-
408
-  # Finally load all agent classes after necessary class methods are defined.
409
-  load_types_in "Agents"
410 406
 end
411 407
 
412 408
 class AgentDrop

+ 0 - 2
app/models/event.rb

@@ -1,5 +1,3 @@
1
-require 'json_serialized_field'
2
-
3 1
 # Events are how Huginn Agents communicate and log information about the world.  Events can be emitted and received by
4 2
 # Agents.  They contain a serialized `payload` of arbitrary JSON data, as well as optional `lat`, `lng`, and `expires_at`
5 3
 # fields.